<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>vue实例</title>
		<script type="text/javascript" src="js/vue.js" ></script>
	</head>
	<body>
		<div id="root" @click="handlerClick">
			{{message}}
			<item></item>
		</div>
		<script>
			
			Vue.component("item", {
				template: '<div>hello item</div>'
			})
			
			var vm = new Vue({
				el: "#root",
				data: {
					message: "hello world"
				},
				methods: {
					handlerClick: function() {
						alert(this.message)
					}
				}
			})
		</script>
	</body>
</html>
